{{define "Next/side"}}
<aside class="side">
    {{if .ToC}}
    <div>
        <div class="side__tab side__tab--current" data-type="toc">{{.I18n.Toc}}</div>
        <div class="side__tab" data-type="gist">{{.I18n.Gist}}</div>
    </div>

    <div id="sideToc" class="current">
        {{.ToC}}
    </div>
    {{end}}

    <div id="sideGist"{{if .ToC}}{{else}} class="current"{{end}}>
        <a href="{{.BlogURL}}" class="side__logo">
            <img data-src="{{.LogoURL}}">
        </a>

        <div class="side__sub-title">{{.Setting.BasicBlogSubtitle}}</div>
        <div class="side__board">{{.Setting.BasicNoticeBoard}}</div>

        {{if eq .User.URole 0}}
        <a href="{{.Conf.Server}}/register" class="side__btn">{{.I18n.Register}}</a>
        <a href="{{.Conf.Server}}/login" class="side__btn">{{.I18n.Login}}</a>
        {{else}}
        <a class="side__btn"
           href="{{.Conf.Server}}/{{if ne .User.URole 4}}admin/{{end}}">{{.I18n.Manage}}</a>
        {{end}}

        {{if le 1 (len .MostUseCategories)}}
        <div class="side__title">{{.I18n.Categories}}</div>
        <div>
            {{range .MostUseCategories}}
            <a class="side__a" href="{{.URL}}">{{.Title}}</a>
            {{end}}
        </div>
        {{end}}
        {{if le 1 (len .MostUseTags)}}
        <div class="side__title">{{.I18n.Tags}}</div>
        <div>
            {{range .MostUseTags}}
            <a class="side__a" href="{{.URL}}">{{.Title}}</a>
            {{end}}
        </div>
        {{end}}
    </div>
</aside>
{{end}}